﻿<!doctype html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="renderer" content="webkit" />
	    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">
        <title>iNEWU 爱牛油 - 在线观看免费正版高清亚洲电视剧、电影、综艺、动漫 - 独家韩剧、陆剧、泰剧 </title>
        <link href="favicon.ico" rel="shortcut icon">
	    <script src="js/common/axios.min.js"></script>
        <script src="js/common/vue.js"></script>
        <script src="js/common/template.js"></script>
        <script src="js/common/vue-resource.js"></script>
        <script src="js/common/httpVueLoader.js"></script>
        <link rel="stylesheet" href="css/common/swiper.css">
        <link rel="stylesheet" href="css/common/base.css">
        <link rel="stylesheet" href="css/common/media.css">
        <link rel="stylesheet" href="css/search.css">
        <script src="https://cdn.tailwindcss.com"></script>
        <style type="text/css">
            [v-cloak]{
              display: none;
            }
        </style>
    </head>
    <body>
        <div id="contn">
            <v-header></v-header>
            <v-main @call-share="share"></v-main>
            <v-footer></v-footer>
            <v-notice ref="noticeRef"></v-notice>
            <v-side></v-side>
            <v-share ref="shareRef" @call-add-notice="addNotice"></v-share>
        </div>
        <template id="vMain">
            <main v-cloak>
               <div class="top">
                    <p class="txt">根据您输入的关键词“{{query}}”, 为您找到以下搜索结果</p>
               </div>
               <div class="palace">
                    <div class="fluid flex flex-between">
                        <div class="list">
                            <div class="item" v-for="item in list" :class="item.videoType">
                                <p class="video-type">{{item.videoTypeName}}</p>
                                <div class="box flex">
                                    <a href="info.html" target="_blank" class="cover">
                                        <div class="mid">
                                            <img :src="item.cover" class="fc">
                                            <p class="type" v-if="item.type">{{item.type}}</p>
                                        </div>
                                    </a>
                                    <div class="dtls">
                                        <a href="info.html" target="_blank" class="name l2">
                                            <span v-for="sItm in item.names" :class="{match:sItm.match}">{{sItm.val}}</span>
                                        </a>
                                        <div class="group">
                                            <div class="item">
                                                <span class="lbl">年份：</span>
                                                <span>{{item.year}}</span>
                                            </div>
                                            <div class="item" v-if="item.producers.length">
                                                <span class="lbl">导演：</span>
                                                <span v-for="sItm in item.producers" class="sItm">
                                                    <a href="actor.html" target="_blank">{{sItm.name}}，</a>
                                                </span>
                                            </div>
                                            <div class="item" v-if="item.actors.length">
                                                <span class="lbl">主演：</span>
                                                <span v-for="sItm in item.actors" class="sItm">
                                                    <a href="actor.html" target="_blank">{{sItm.name}}，</a>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="series" :class="[item.videoType == 'tv'?'flex flex-wrap':'']">
                                            <template v-if="item.videoType == 'tv'">
                                                <a href="play.html" target="_blank" class="item mid" v-for="sItm in item.series">
                                                    <p class="hvc">{{sItm}}</p>
                                                </a>
                                            </template>
                                            <template v-if="item.videoType == 'show'">
                                                <template v-for="(sItm,s) in item.series">
                                                    <a href="play.html" target="_blank" class="item l1" v-if="s < 4">
                                                        {{sItm.name}}
                                                    </a>
                                                </template>                                                
                                            </template>
                                        </div>
                                        <a href="info" target="_blank" class="flex flex-align-items more" v-if="item.more">
                                            显示更多<img src="img/common/arw.png">
                                        </a>
                                        <a class="watch" href="play.html" target="_blank">立即观看</a>
                                    </div>
                                </div>
                                <div class="series" :class="[item.videoType == 'tv'?'flex flex-wrap':'']">
                                    <template v-if="item.videoType == 'tv'">
                                        <a href="play.html" target="_blank" class="item mid" v-for="sItm in item.series" >
                                            <p class="hvc">{{sItm}}</p>
                                        </a>
                                    </template>
                                    <template v-if="item.videoType == 'show'">
                                        <template v-for="(sItm,s) in item.series">
                                            <a href="play.html" target="_blank" class="item l1" v-if="s < 2">
                                                {{sItm.name}}
                                            </a>
                                        </template>                                                
                                    </template>
                                </div>
                                <a href="info" target="_blank" class="flex flex-align-items flex-justify-content more" v-if="item.more">
                                    显示更多<img src="img/common/arw.png">
                                </a>
                            </div>
                            <div class="load-box">
                                <p class="load"></p>
                            </div>
                        </div>
                        <div class="hot">
                            <p class="ttl">热门搜索</p>
                            <div class="ary">
                                <a href="info.html" target="_blank" v-for="(item,i) in hot">
                                    <span class="num iv">{{i + 1}}</span>
                                    <span>{{item.name}}</span>
                                </a>
                            </div>
                        </div>
                    </div>
               </div>
            </main>
        </template>
        
        
        <script src="js/common/swiper.js"></script>
        <script src="js/common/jquery.js"></script>
        <script src="js/common/dataUrl.js"></script>
        <script>
            Vue.use(httpVueLoader);
            var contn = new Vue({
                el:'#contn',
                data:{
                   
                },
                methods:{
                    share(obj){
                        this.$refs.shareRef.hdlShow('img/index/a2.jpg');
                    },
                    addNotice(msg,type){
                        console.log(msg,type);
                        this.$refs.noticeRef.add({
                            msg:msg,
                            type:type,
                            time:new Date().getTime()
                        });
                    },
                },
                mounted:function(){
                    ifMounted = true;
                },
                components:{
                    'v-header': 'url:./js/common/v-header.vue',
                    'v-footer': 'url:./js/common/v-footer.vue',
                    'v-notice': 'url:./js/common/v-notice.vue',
                    'v-side': 'url:./js/common/v-side.vue',
                    'v-share': 'url:./js/common/v-share.vue',
                    vMain:{
                        template: '#vMain',
                        data:function(){
                            return{
                                query:decodeURI(GetQueryString('query')),
                                originInput:decodeURI(GetQueryString('originInput')),
                                list:[
                                    {name:'我的反派男友',cover:'img/search/2.jpg',videoTypeName:'电视剧',
                                    videoType:'tv',
                                    seriesNum:40,
                                    type:'自制',
                                    actors:[
                                        {name:'李沁'},
                                        {name:'范冰冰'},
                                    ],
                                    producers:[
                                        {name:'朱锐斌'},
                                        {name:'蓝志伟'},
                                    ],
                                    year:'2024'},
                                    {name:'我的反派男友 AI英文版',cover:'img/search/2.jpg',videoTypeName:'电视剧',
                                    videoType:'tv',
                                    seriesNum:5,
                                    type:'自制',
                                    actors:[
                                        {name:'李沁'},
                                        {name:'范冰冰'},
                                    ],
                                    producers:[
                                        {name:'朱锐斌'},
                                        {name:'蓝志伟'},
                                    ],
                                    year:'2024'},
                                    {name:'我的演技派男友',cover:'img/search/1.jpg',videoTypeName:'电影',
                                    videoType:'movie',
                                    type:'',
                                    actors:[
                                        {name:'李沁'},
                                        {name:'范冰冰'},
                                    ],
                                    producers:[
                                        {name:'朱锐斌'},
                                        {name:'蓝志伟'},
                                    ],
                                    year:'2025'},
                                    {name:'我的学霸男友',cover:'img/search/3.jpg',videoTypeName:'综艺',
                                    videoType:'show',
                                    type:'免费',
                                    actors:[
                                        
                                    ],
                                    producers:[
                                        
                                    ],
                                    series:[
                                        {name:'名称名称名称名称名称名称名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                        {name:'名称名称名称名称名称名称'},
                                    ],
                                    year:'2021'},
                                ],
                                hot:[
                                    {name:'不眠日'},
                                    {name:'一笑随歌'},
                                    {name:'你的天空'},
                                    {name:'终极笔记'},
                                    {name:'穿越天际靠近你'},
                                    {name:'与晋长安'},
                                    {name:'一年一度喜剧大赛'},
                                    {name:'心口不一'},
                                    {name:'灵魂重生'},
                                    {name:'复仇者'},
                                ],
                                sizeRange:[
                                    {windowWid:1679,row:13},
                                    {windowWid:1024,row:9},
                                    {windowWid:768,row:11},
                                    {windowWid:0,row:6},

                                ],
                            }
                        },
                        methods:{
                            collect(ind){
                                this.$refs.noticeRef.add({
                                    msg:'收藏成功',
                                    type:'success',
                                    time:new Date().getTime()
                                });
                            },
                            
                            splitName(name){
                                let ary = [];
                                let names = [];
                                let splitVal = '';
                                let tempStr = '';
                                if(name.indexOf(this.query) >= 0){
                                    splitVal = this.query;
                                }else{
                                    splitVal = this.originInput;
                                }
                                let lastIndex = 0;
                                let currentIndex = name.indexOf(splitVal);

                                while (currentIndex !== -1) {
                                    // 添加前一部分
                                    if (currentIndex > lastIndex) {
                                        ary.push(name.slice(lastIndex, currentIndex));
                                    }
                                    // 添加关键词
                                    ary.push(splitVal);
                                    // 更新索引
                                    lastIndex = currentIndex + splitVal.length;
                                    currentIndex = name.indexOf(splitVal, lastIndex);
                                }

                                // 添加剩余部分
                                if (lastIndex < name.length) {
                                    ary.push(name.slice(lastIndex));
                                }
                                ary.forEach(item=>{
                                   names.push({
                                        val:item,
                                        match:item.indexOf(splitVal) >= 0?true:false,
                                   }) 
                                })
                                console.log(names);
                                return names;
                            },
                            prepareName(){
                                let This = this;
                                let ary = newObj(this.list);
                                ary.forEach(item => {
                                    item.names = This.splitName(item.name);
                                });
                                console.log(ary);
                                this.list = ary;
                            },
                            init() {
                                let ary = newObj(this.list);
                                let This = this;
                                ary.forEach(item => {
                                    let currSit;
                                    let currSitInd;
                                    for(var r = 0;r < This.sizeRange.length;r++){
                                        if(window.innerWidth > This.sizeRange[r].windowWid){
                                            currSit = This.sizeRange[r];
                                            currSitInd = r;
                                            break;
                                        }
                                    }
                                    item.more = false;
                                    if(item.videoType == 'tv'){
                                        if(item.seriesNum > currSit.row * 2){
                                            item.more = true;
                                            let arr1,arr2;
                                            if(currSitInd == 0){
                                                arr1 = new Array(currSit.row - 1).fill(0).map((_, i) => i + 1);
                                                arr1.push('...');
                                                let startVal = item.seriesNum - currSit.row;
                                                arr2 = Array(currSit.row + 1).fill().map((_, i) => startVal + i);
                                                console.log(arr1,arr2);
                                            }else if(currSitInd != 3){
                                                arr1 = new Array(currSit.row - 1).fill(0).map((_, i) => i + 1);
                                                arr1.push('...');
                                                let startVal = item.seriesNum - currSit.row + 1;
                                                arr2 = Array(currSit.row).fill().map((_, i) => startVal + i);
                                                console.log(arr1,arr2);
                                            }else{
                                                arr1 = [1,'...'];
                                                let startVal = item.seriesNum - currSit.row + 3;
                                                arr2 = Array(currSit.row - 2).fill().map((_, i) => startVal + i);
                                                console.log(arr1,arr2);
                                            }
                                            item.series = arr1.concat(arr2);
                                        }else{
                                            item.series = new Array(item.seriesNum).fill(0).map((_, i) => i + 1);
                                        }
                                    }else if(item.videoType == 'show'){
                                        item.more = item.series.length > 4?true:false;
                                    }
                                    
                                });
                                this.list = ary;
                            }
                        },
                        beforeDestroy() {
                            window.removeEventListener('resize', this.init)
                        },
                        mounted:function(){
                            var This = this;
                            // this.writingWeb();
                            this.prepareName();
                            this.init();
                            window.addEventListener('resize', this.init)
                        }
                    },
                },
            })
            
        </script>
        <script src="js/common/common.js"></script>
        <script src="js/common/animation.js"></script>
        <script src="js/index.js"></script>
    </body>
</html>